/*****************************************************************************/
/**
*
* @file led.h
*
* Header file for bsp_gpio.c.
* Target device: STM32F103RET6.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who    Date   	Changes
* ----- ---- ---------- -------------------------------------------------------
* 0.01  abu  01/22/2020 Created
* </pre>
*
*------------------------------------------------------------------------------
* Author:	abu
*					E-mail:	abu_liu@opencores.org
*------------------------------------------------------------------------------
*
******************************************************************************/
#ifndef LED_H		/* prevent circular inclusions */
#define LED_H		/* by using protection macros */

#ifdef __cplusplus
	extern "C" {
#endif

/***************************** Include Files *********************************/
#include "stm32f10x.h"

/************************** Constant Definitions *****************************/
#define LED_GREEN_PORT	GPIOC
#define LED_RED_PORT	GPIOC
#define LED_YELLOW_PORT	GPIOA
#define LED_BLUE_PORT	GPIOC

#define LED_GREEN_PIN GPIO_Pin_8
#define LED_RED_PIN GPIO_Pin_7
#define LED_YELLOW_PIN GPIO_Pin_12
#define LED_BLUE_PIN GPIO_Pin_10
		
#define LED_GREEN_ON()	GPIO_ResetBits(LED_GREEN_PORT,LED_GREEN_PIN)
#define LED_RED_ON()		GPIO_ResetBits(LED_RED_PORT,LED_RED_PIN)
#define LED_YELLOW_ON()	GPIO_ResetBits(LED_YELLOW_PORT,LED_YELLOW_PIN)
#define	LED_BLUE_ON()		GPIO_ResetBits(LED_BLUE_PORT,LED_BLUE_PIN)

#define LED_GREEN_OFF()		GPIO_SetBits(LED_GREEN_PORT,LED_GREEN_PIN)
#define LED_RED_OFF()			GPIO_SetBits(LED_RED_PORT,LED_RED_PIN)
#define LED_YELLOW_OFF()	GPIO_SetBits(LED_YELLOW_PORT,LED_YELLOW_PIN)
#define	LED_BLUE_OFF()		GPIO_SetBits(LED_BLUE_PORT,LED_BLUE_PIN)

/************************** Function Declarations ******************************/
void led_init(void);
void Led_Yellow_Toggle(void);
void Led_Red_Toggle(void);
void Led_Green_Toggle(void);
void Led_Blue_Toggle(void);
		
#ifdef __cplusplus
}
#endif

#endif
